package com.tx.boot_demo.domain;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 *
 */
@Component
@PropertySource(value = {"classpath:my.properties"})
@ConfigurationProperties(prefix = "food")
public class Food {

    private String name;

    private int money;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Food{" +
                "name='" + name + '\'' +
                ", money=" + money +
                '}';
    }
}